package com.twu.biblioteca;
import java.util.ArrayList;

/**
 * Created by IntelliJ IDEA.
 * User: dixithk
 * Date: 6/10/14
 * Time: 11:32 AM
 * To change this template use File | Settings | File Templates.
 */
public class Library {

    
    public ArrayList<Book> allbooks = new ArrayList<Book>();
    Library()
    {
        allbooks.add(new Book("let us c" , "mark" ,1993));
        allbooks.add(new Book("Head first Java" , "Me" , 2001));
        allbooks.add(new Book("Training in sql" , "Jack ",2013));
        allbooks.add(new Book("Edge of Tomorrow" , "Tom cruise" , 2014));


    }

    public String printAllBooks()
    {
        String ListOfBooksInString ="";

        for(int eachBook =0 ; eachBook < this.allbooks.size() ; eachBook++)
        {
            ListOfBooksInString+= this.allbooks.get(eachBook).title +"\t"+this.allbooks.get(eachBook).authorName + "\t"+this.allbooks.get(eachBook).publishedYear+'\n';
            
        }
        System.out.println(ListOfBooksInString);
        return ListOfBooksInString;
    }
    


}
